 Re: EDuke32 Scripting (CON coding) 
Here you go.

Necessary definitions:


Code:
define ACTORFACINGRANGE 257 // You can adjust this here to enlarge or shrink the range necessary to activate the code that is only run when the actor is facing another.

gamevar TEMP 0 2
gamevar TEMP2 0 2
gamevar FOUNDACTOR 0 2
gamevar x 0 2
gamevar y 0 2
gamevar MX 0 2
gamevar MY 0 2
gamevar ANGVAR 0 2

Put this in your monster's code:


Code:
findnearactor APLAYER <necessary distance between them> FOUNDACTOR
ifvarn FOUNDACTOR -1
  {
    getactor[FOUNDACTOR].x MX
    getactor[FOUNDACTOR].y MY
    getactor[THISACTOR].x x
    getactor[THISACTOR].y y
    subvarvar MX x
    subvarvar MY y
    getangle ANGVAR MX MY
    setvarvar TEMP ANGVAR
    setvarvar TEMP2 ANGVAR
    subvar TEMP ACTORFACINGRANGE
    addvar TEMP2 ACTORFACINGRANGE
    getactor[THISACTOR].ang ANGVAR
    ifvarvarg ANGVAR TEMP
      {
        ifvarvarl ANGVAR TEMP2
          {
            <insert code here>
          }
      }
  }The meat of the code was taken from TerminX's How to Make One Actor Face Another tutorial. I just added on the part of the calculation of the angle range. 
__________________
 